From 4bac454c0763ad05868bb93ee8581b7348ec1b3c Mon Sep 17 00:00:00 2001 From: Lance Lin Date: Wed, 13 Apr 2022 19:40:54 +0700 Subject: [PATCH] Changed dcmtk user shell to nologin, added a check to delete the dcmtk user on uninstall if it exists (Closes: #987972 --- debian/changelog | 7 +++++++ debian/dcmtk.postinst | 2 +- debian/dcmtk.postrm | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 710b0a37..9a44ab69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +dcmtk (3.6.6-6) UNRELEASED; urgency=medium + + * d/dcmtk.postrm: Added check to remove dcmtk user (Closes: #987972) + * d/dcmtk.postinst: Change dcmtk user shell to nologin + + -- Lance Lin Wed, 13 Apr 2022 19:36:57 +0700 + dcmtk (3.6.6-5) unstable; urgency=medium * d/rules: Re-exposed --interleave-none option. Closes: #1001703 diff --git a/debian/dcmtk.postinst b/debian/dcmtk.postinst index 42a34251..525636d9 100644 --- a/debian/dcmtk.postinst +++ b/debian/dcmtk.postinst @@ -11,7 +11,7 @@ if ! getent passwd dcmtk >/dev/null 2>&1; then fi echo "Adding \`dcmtk' user to system ..." adduser --quiet --system --ingroup dcmtk --home /var/lib/dcmtk/db \ - --shell /bin/sh --disabled-password dcmtk || true + --shell /usr/sbin/nologin dcmtk || true fi # work around possible adduser bug, see #119366 diff --git a/debian/dcmtk.postrm b/debian/dcmtk.postrm index 7365e3be..17d01187 100644 --- a/debian/dcmtk.postrm +++ b/debian/dcmtk.postrm @@ -15,5 +15,11 @@ if [ "$1" = "purge" ] ; then fi fi +# Remove dcmtk user/group if they exist on cleanup +if -u "dcmtk" > /dev/null 2>&1; then + echo "Removing 'dcmtk' user and group from the system...\n" + userdel dcmtk +fi + #DEBHELPER# -- 2.30.2